package com.hall.controller;

import com.hall.pojo.Answer;
import com.hall.service.AnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 *app下载
 */
@Controller
@RequestMapping("/appdownload")
public class appdownloadController {
   @RequestMapping(value = "todownload")
    public String  appdownload(HttpServletRequest request, HttpServletResponse response,Model model){
     String agent=request.getHeader("User-Agent");
     if(agent.contains("Android")&&agent.contains("Weixin")){
          model.addAttribute("weixin","OK");
          return "downloadapp";
      }
      if(agent.contains("iPhone")){
          return "redirect:https://testflight.apple.com/join/qrHg5BvZ";
      }
      return "redirect:https://www.pgyer.com/Innv";
    }
}
